﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Maintainance/Maintainance.master" AutoEventWireup="true" CodeBehind="Albums.aspx.cs" Inherits="OpenPhotoAlbum.Maintainance.Albums" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ph1" runat="server">
<asp:UpdatePanel ID="up" runat="server">
	<ContentTemplate>
		<asp:GridView ID="gridView" runat="server" AllowPaging="True" PageSize="15" AllowSorting="True" 
				AutoGenerateColumns="False" DataKeyNames="AlbumId" 
				DataSourceID="LinqDataSource1" Font-Size="0.85em">
			<Columns>
				<asp:TemplateField HeaderText="User" SortExpression="User.UserName">
					<ItemTemplate>
						<a href="<%# OpenPhotoAlbum.UrlContext.BuildSharedHomeUrl((string)Eval("User.UserName")) %>" target="_blank">
							<%# Eval("User.UserName") %>
						</a>
					</ItemTemplate>
				</asp:TemplateField>
				<asp:BoundField DataField="AlbumTitle" HeaderText="AlbumTitle" 
					SortExpression="AlbumTitle" />
				<asp:BoundField DataField="AlbumDescription" HeaderText="AlbumDescription" 
					SortExpression="AlbumDescription" />
				<asp:TemplateField HeaderText="Photos" SortExpression="Photos.Count">
					<ItemTemplate>
						<%# Eval("Photos.Count") %>
					</ItemTemplate>
				</asp:TemplateField>
				<asp:BoundField DataField="AlbumCreationDate" HeaderText="AlbumCreationDate" 
					SortExpression="AlbumCreationDate" />
				<asp:BoundField DataField="AlbumModificationDate" 
					HeaderText="AlbumModificationDate" SortExpression="AlbumModificationDate" />
				<asp:BoundField DataField="Recommended" 
					HeaderText="Recommended" SortExpression="Recommended" />
				<asp:ButtonField ButtonType="Button" CommandName="Recommend" 
					HeaderText="Recommended" Text="Set/Unset" />
				<asp:TemplateField HeaderText="View">
					<ItemTemplate>
						<a href="<%# OpenPhotoAlbum.UrlContext.BuildSharedAlbumUrl((Guid)Eval("AlbumId")) %>" target="_blank">View</a>
					</ItemTemplate>
					<ItemStyle Font-Bold="True" />
				</asp:TemplateField>
			</Columns>
			</asp:GridView>
			<asp:LinqDataSource ID="LinqDataSource1" runat="server" 
				ContextTypeName="OpenPhotoAlbum.DbAccess.DbLinqClassesDataContext" 
				TableName="Albums" OrderBy="AlbumCreationDate desc">
			</asp:LinqDataSource>
		</ContentTemplate>
	</asp:UpdatePanel>
</asp:Content>
